<template>
  <div id="BasicInfo">
    <span
        style="
    align-items: center;
    justify-content: space-around;
    flex-direction: column;
    font-size: 20px"
    >项目基本信息</span>
    <el-icon size="25px" @click="toFirst">
      <Setting/>
    </el-icon>
    <el-row :gutter="20" style="margin: 10px auto">
      <el-col :span="8">
        <el-input :model-value="PMConfig.name" disabled>
          <template #prepend>项目名称:</template>
        </el-input>
      </el-col>
      <el-col :span="8">
        <el-input :model-value="form.LeaderName" disabled>
          <template #prepend>负责人:</template>
        </el-input>
      </el-col>
      <el-col :span="8">
        <el-input :model-value="date" disabled>
          <template #prepend>启动日期:</template>
        </el-input>
      </el-col>
    </el-row>
  </div>
</template>

<script lang="ts" setup>
import router from '@/router'
import {Setting} from '@element-plus/icons-vue'
import {usePMConfig} from '@/stores/PMConfig'
import {useProgressConfigStore} from '@/stores/ProgressConfig'
import {getLeaderUserApi} from "@/api/User";
import {ref} from "vue";

const ProgressConfigStore = useProgressConfigStore()
const PMConfig = usePMConfig()

const date = ProgressConfigStore.tabledata[0].date + '-' + PMConfig.startDate.getDate()

const getLeaderName = () => {
  getLeaderUserApi(PMConfig.head).then(res => {
    form.value.LeaderName = res['data'].userName
  })
}
getLeaderName()
const form = ref({
  LeaderName: ''
})
const toFirst = () => {
  PMConfig.isChangeDate = false
  router.push('/home/programmanagement/newconfig/1')
}

</script>

<style scoped>

</style>
